Ext.onReady(function() {
	Ext.QuickTips.init(); // 如要实现错误提示，需要此初始化
	Ext.form.Field.prototype.msgTarget = 'side';

	var height = this.document.documentElement.clientHeight;
	var width = this.document.documentElement.clientWidth;

	// top区域开始

	// top区域结束

	// 案件区域开始
	var casesm = new Ext.grid.CheckboxSelectionModel();

	var casecm = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), casesm,
			{
				header : "案卷编号",
				dataIndex : "recdispnum",
				sortable : true
			}, {
				header : "任务号",
				dataIndex : "tasknum",
				sortable : true
			}, {
				header : "处置及时状态",
				dataIndex : "acttimestateid",
				sortable : true
			}, {
				header : "案卷类型",
				dataIndex : "recordtype",
				sortable : true
			}, {
				header : "案卷办理阶段",
				dataIndex : "recordprocessstate",
				sortable : true
			}, {
				header : "上报监督员",
				dataIndex : "reportpatrol",
				sortable : true
			}, {
				header : "核实监督员",
				dataIndex : "verifypatrol",
				sortable : true
			}, {
				header : "核查监督员",
				dataIndex : "examinepatrol",
				sortable : true
			}, {
				header : "受理接线员",
				dataIndex : "acceptoperator",
				sortable : true
			}, {
				header : "立案值班长",
				dataIndex : "accreditationdutyperson",
				sortable : true
			}, {
				header : "派遣员",
				dataIndex : "dispatchor",
				sortable : true
			}, {
				header : "二级派遣员",
				dataIndex : "seconddispatchor",
				sortable : true
			}, {
				header : "督查员",
				dataIndex : "inspectior",
				sortable : true
			}, {
				header : "核查接线员",
				dataIndex : "examineoperator",
				sortable : true
			}, {
				header : "结案人员",
				dataIndex : "closepeople",
				sortable : true
			}, {
				header : "紧急状态",
				dataIndex : "eventurgen",
				sortable : true
			}, {
				header : "处置时限",
				dataIndex : "disposetimelimit",
				sortable : true
			}, {
				header : "处置截止时间",
				dataIndex : "disposedeadline",
				sortable : true
			}, {
				header : "处置时间",
				dataIndex : "disposedate",
				sortable : true
			}, {
				header : "处置用时",
				dataIndex : "disposetimes",
				sortable : true
			}, {
				header : "延期时长",
				dataIndex : "delaytimes",
				sortable : true
			}, {
				header : "超时倍数",
				dataIndex : "overtimemultiple",
				sortable : true
			}, {
				header : "受理开始时间",
				dataIndex : "acceptstarttime",
				sortable : true
			}, {
				header : "受理结束时间",
				dataIndex : "acceptendtime",
				sortable : true
			}, {
				header : "立案开始时间",
				dataIndex : "registerstarttime",
				sortable : true
			}, {
				header : "立案结束时间",
				dataIndex : "registerendtime",
				sortable : true
			}, {
				header : "结案开始时间",
				dataIndex : "endcasestarttime",
				sortable : true
			}, {
				header : "结案结束时间",
				dataIndex : "endcaseendtime",
				sortable : true
			}, {
				header : "结案时间",
				dataIndex : "endcasetime",
				sortable : true
			}, {
				header : "缓办时间",
				dataIndex : "postponedtime",
				sortable : true
			}, {
				header : "作废时间",
				dataIndex : "abandontime",
				sortable : true
			}, {
				header : "在办人员",
				dataIndex : "workingstaff",
				sortable : true
			}, {
				header : "在办部门",
				dataIndex : "workingdept",
				sortable : true
			}, {
				header : "返工开始时间",
				dataIndex : "backstarttime",
				sortable : true
			}, {
				header : "缓办类型",
				dataIndex : "postpinedtype",
				sortable : true
			}, {
				header : "挂账类型",
				dataIndex : "onticktype",
				sortable : true
			}, {
				header : "延期类型",
				dataIndex : "delaytype",
				sortable : true
			}, {
				header : "巡查编号",
				dataIndex : "patrolid",
				sortable : true
			},{
                header : "部门编号",
                dataIndex : "domaindeptID",
                sortable : true
            }]);

	var aaProxy = new Ext.data.HttpProxy({
				url : "casecon",
				method : "GET"
			});

	var casestore = new Ext.data.Store({
				proxy : aaProxy,
				reader : new Ext.data.JsonReader({})
			});
	casestore.load();
	var casepp = new Ext.grid.GridPanel({
		id : 'casepp',
		title : '案件信息',
		region : 'center',
		autoShow : true,
		height : height,
		width : width,

		split : true,
		minSize : 175,
		maxSize : 400,
		frame : true,
		columnLines : true,
		sm : casesm,
		store : casestore,
		cm : casecm,
		tbar : [{
			pressed : false,
			text : '添加案件',
			icon : "static/images/add.gif",
			handler : function() {
				var Trecdispnum = new Ext.form.Field({
							id : 'recdispnum',
							name : 'recdispnum',
							allowBlank : true,
							fieldLabel : "案卷编号"
						});
				var Ttasknum = new Ext.form.Field({
							id : 'tasknum',
							name : 'tasknum',
							allowBlank : true,
							fieldLabel : "任务号"
						});
				var TproblemID = new Ext.form.Field({
							id : 'problemID',
							name : 'problemID',
							allowBlank : true,
							fieldLabel : "问题编号"
						});
				var Trecordtype = new Ext.form.Field({
							id : 'recordtype',
							name : 'recordtype',
							allowBlank : true,
							fieldLabel : "案卷类型"
						});
				var Trecordprocessstate = new Ext.form.Field({
							id : 'recordprocessstate',
							name : 'recordprocessstate',
							allowBlank : true,
							fieldLabel : "案卷办理阶段"
						});
				var Treportpatrol = new Ext.form.Field({
							id : 'reportpatrol',
							name : 'reportpatrol',
							allowBlank : true,
							fieldLabel : "上报监督员"
						});
				var Tverifypatrol = new Ext.form.Field({
							id : 'verifypatrol',
							name : 'verifypatrol',
							allowBlank : true,
							fieldLabel : "核实监督员"
						});
				var Texaminepatrol = new Ext.form.Field({
							id : 'examinepatrol',
							name : 'examinepatrol',
							allowBlank : true,
							fieldLabel : "核查监督员"
						});
				var Tacceptoperator = new Ext.form.Field({
							id : 'acceptoperator',
							name : 'acceptoperator',
							allowBlank : true,
							fieldLabel : "受理接线员"
						});
				var Taccreditationdutyperson = new Ext.form.Field({
							id : 'accreditationdutyperson',
							name : 'accreditationdutyperson',
							allowBlank : true,
							fieldLabel : "立案值班长"
						});
				var Tdispatchor = new Ext.form.Field({
							id : 'dispatchor',
							name : 'dispatchor',
							allowBlank : true,
							fieldLabel : "派遣员"
						});
				var Tseconddispatchor = new Ext.form.Field({
							id : 'seconddispatchor',
							name : 'seconddispatchor',
							allowBlank : true,
							fieldLabel : "二级派遣员"
						});
				var Tinspectior = new Ext.form.Field({
							id : 'inspectior',
							name : 'inspectior',
							allowBlank : true,
							fieldLabel : "督查员"
						});
				var Texamineoperator = new Ext.form.Field({
							id : 'examineoperator',
							name : 'examineoperator',
							allowBlank : true,
							fieldLabel : "核查接线员"
						});
				var Tclosepeople = new Ext.form.Field({
							id : 'closepeople',
							name : 'closepeople',
							allowBlank : true,
							fieldLabel : "结案人员"
						});
				var Teventurgen = new Ext.form.Field({
							id : 'eventurgen',
							name : 'eventurgen',
							allowBlank : true,
							fieldLabel : "紧急状态"
						});
				var Tdisposetimelimit = new Ext.form.Field({
							id : 'disposetimelimit',
							name : 'disposetimelimit',
							allowBlank : true,
							fieldLabel : "处置时限"
						});
				var Tdisposedeadline = new Ext.form.DateField({
							id : 'disposedeadline',
							name : 'disposedeadline',
							allowBlank : true,
							fieldLabel : "处置截止时间",
                            value:'01/01/1990'
						});
				var Tdisposedate = new Ext.form.DateField({
							id : 'disposedate',
							name : 'disposedate',
							allowBlank : true,
							fieldLabel : "处置时间",
                            value:'01/01/1990'
						});
				var Tdisposetimes = new Ext.form.Field({
							id : 'disposetimes',
							name : 'disposetimes',
							allowBlank : true,
							fieldLabel : "处置用时"
						});
				var Tdelaytimes = new Ext.form.Field({
							id : 'delaytimes',
							name : 'delaytimes',
							allowBlank : true,
							fieldLabel : "延期时长"
						});
				var Tovertimemultiple = new Ext.form.Field({
							id : 'overtimemultiple',
							name : 'overtimemultiple',
							allowBlank : true,
							fieldLabel : "超时倍数"
						});
				var Tacceptstarttime = new Ext.form.DateField({
							id : 'acceptstarttime',
							name : 'acceptstarttime',
							allowBlank : true,
							fieldLabel : "受理开始时间",
                            value:'01/01/1990'
						});
				var Tacceptendtime = new Ext.form.DateField({
							id : 'acceptendtime',
							name : 'acceptendtime',
							allowBlank : true,
							fieldLabel : "受理结束时间",
                            value:'01/01/1990'
						});
				var Tregisterstarttime = new Ext.form.DateField({
							id : 'registerstarttime',
							name : 'registerstarttime',
							allowBlank : true,
							fieldLabel : "立案开始时间",
                            value:'01/01/1990'
						});
				var Tregisterendtime = new Ext.form.DateField({
							id : 'registerendtime',
							name : 'registerendtime',
							allowBlank : true,
							fieldLabel : "立案结束时间",
                            value:'01/01/1990'
						});
				var Tendcasestarttime = new Ext.form.DateField({
							id : 'endcasestarttime',
							name : 'endcasestarttime',
							allowBlank : true,
							fieldLabel : "结案开始时间",
                            value:'01/01/1990'
						});
				var Tendcaseendtime = new Ext.form.DateField({
							id : 'endcaseendtime',
							name : 'endcaseendtime',
							allowBlank : true,
							fieldLabel : "结案结束时间",
                            value:'01/01/1990'
						});
				var Tendcasetime = new Ext.form.DateField({
							id : 'endcasetime',
							name : 'endcasetime',
							allowBlank : true,
							fieldLabel : "结案时间",
                            value:'01/01/1990'
						});
				var Tpostponedtime = new Ext.form.DateField({
							id : 'postponedtime',
							name : 'postponedtime',
							allowBlank : true,
							fieldLabel : "缓办时间",
                            value:'01/01/1990'
						});
				var Tabandontime = new Ext.form.DateField({
							id : 'abandontime',
							name : 'abandontime',
							allowBlank : true,
							fieldLabel : "作废时间",
                            value:'01/01/1990'
						});
				var Tworkingstaff = new Ext.form.Field({
							id : 'workingstaff',
							name : 'workingstaff',
							allowBlank : true,
							fieldLabel : "在办人员"
						});
				var Tworkingdept = new Ext.form.Field({
							id : 'workingdept',
							name : 'workingdept',
							allowBlank : true,
							fieldLabel : "在办部门"
						});
				var Tbackstarttime = new Ext.form.DateField({
							id : 'backstarttime',
							name : 'backstarttime',
							allowBlank : true,
							fieldLabel : "返工开始时间",
                            value:'01/01/1990'
						});
				var Tpostpinedtype = new Ext.form.Field({
							id : 'postpinedtype',
							name : 'postpinedtype',
							allowBlank : true,
							fieldLabel : "缓办类型"
						});
				var Tonticktype = new Ext.form.Field({
							id : 'onticktype',
							name : 'onticktype',
							allowBlank : true,
							fieldLabel : "挂账类型"
						});
				var Tdelaytype = new Ext.form.Field({
							id : 'delaytype',
							name : 'delaytype',
							allowBlank : true,
							fieldLabel : "延期类型"
						});
				var Tpatrolid = new Ext.form.Field({
							id : 'patrolid',
							name : 'patrolid',
							allowBlank : true,
							fieldLabel : "巡查编号"
						});
                var TdomaindeptID =new Ext.form.Field({
                                id : 'domaindeptID',
                                name : 'domaindeptID',
                                allowBlank : true,
                                fieldLabel : "部门编号"
                            });
                            
				var formp = new Ext.form.FormPanel({
					title : "案件添加",
					closable : true,
					labelAlign : "right",
					buttonAlign : "center",
					// width : 350,
					// height : 500,
				    height : 450,
					autoWidth : true,
					frame : true,
					split : true,
                    autoScroll:true,
					items : [Trecdispnum, Ttasknum, TproblemID, Trecordtype,
							Trecordprocessstate, Treportpatrol, Tverifypatrol,
							Texaminepatrol, Tacceptoperator,
							Taccreditationdutyperson, Tdispatchor,
							Tseconddispatchor, Tinspectior, Texamineoperator,
							Tclosepeople, Teventurgen, Tdisposedeadline,
							Tdisposedate, Tdelaytimes, Tovertimemultiple,
							Tacceptstarttime, Tacceptendtime,
							Tregisterstarttime, Tregisterendtime,
							Tendcasestarttime, Tendcaseendtime, Tendcasetime,
							Tpostponedtime, Tabandontime, Tworkingstaff,
							Tworkingdept, Tbackstarttime, Tpostpinedtype,
							Tonticktype, Tdelaytype, Tpatrolid,TdomaindeptID],
					url : "casecon?method=add",
					method : "post",
					buttons : [{
						text : "确定",
						icon : "extjsLib/resources/static/images/default/dd/disk.png",
						handler : function() {
							formp.getForm().submit({
										success : function(form, action) {
											var msg = action.result.msg;
											if (msg == "yes") {
												casestore.reload();
												Ext.Msg.alert("成功",
														"恭喜，案件信息添加成功！");
												addwin.close();
											}
											if (msg == "no") {
												Ext.Msg.alert("失败",
														"案件号重复或不存在！");
											}
											// store.reload();
										},
										failure : function(response) {
											Ext.Msg
													.alert("失败",
															"对不起，案件信息添加异常！");
										}
									});
						}
					}, {
						text : "重置",
						icon : "extjsLib/resources/static/images/default/dd/delete.gif",
						handler : function() {
							formp.getForm().reset();
						}
					}]
				});
				var addwin = new Ext.Window({
							title : "",
							width : 350,
							height : 450,
							closeAction : "close",
							closeable : true,
							items : formp,
							collapsible : true,
							autoHeight : true,
                            scrollable:true,
							modal : true
						});
				addwin.show();
			}
		}, {
			xtype : "tbseparator"
		}, {
			pressed : false,
			text : '案件删除',
			icon : "static/images/cross.gif",
			handler : function() {
				var selModel = casepp.getSelectionModel();
				if (selModel.hasSelection()) {
					Ext.Msg.confirm("确认", "您确定要删除选择的记录吗？", function(btn) {
						if (btn == "yes") {
							var records = selModel.getSelections();
							var ids = [];
							for (var i = 0; i < records.length; i++) {
								ids.push(records[i].get("caseID")); // 获取选择的条目id
							}
							Ext.Ajax.request({
										url : "casecon?method=delete",
										params : {
											ids : ids
										},
										method : "post",
										success : function(form, action) {
											Ext.MessageBox.alert("结果", "删除成功！");
											casestore.reload();
										},
										failure : function() {
											var messagestr = response.result.msg;
											alert(messagestr);
											casestore.reload();
											// Ext.Msg
											// .alert(
											// "结果",
											// "对不起，删除异常！");
										}
									});

						}
					});
				} else {
					Ext.Msg.alert("错误", "请选择要删除的行！");
				}
			}
		}, {
			xtype : "tbseparator"
		}, {
			pressed : false,
			text : '修改案件信息',
			icon : "static/images/details.gif",
			handler : function() {
				// Ext.Msg.alert("修改");
				var selModel = casepp.getSelectionModel();
				var record;
				if (!selModel.hasSelection()) {
					Ext.Msg.alert("错误", "请选择要修改的行！");
				} else if (selModel.getSelections().length > 1) {
					Ext.Msg.alert("错误", "一次只能选择一行！");
				} else {
					record = selModel.getSelected();

					var Trecdispnum = new Ext.form.Field({
								id : 'recdispnum',
								name : 'recdispnum',
								allowBlank : true,
								fieldLabel : "案卷编号"
							});
					var Ttasknum = new Ext.form.Field({
								id : 'tasknum',
								name : 'tasknum',
								allowBlank : true,
								fieldLabel : "任务号"
							});
					var TproblemID = new Ext.form.Field({
								id : 'problemID',
								name : 'problemID',
								allowBlank : true,
								fieldLabel : "问题编号"
							});
					var Trecordtype = new Ext.form.Field({
								id : 'recordtype',
								name : 'recordtype',
								allowBlank : true,
								fieldLabel : "案卷类型"
							});
					var Trecordprocessstate = new Ext.form.Field({
								id : 'recordprocessstate',
								name : 'recordprocessstate',
								allowBlank : true,
								fieldLabel : "案卷办理阶段"
							});
					var Treportpatrol = new Ext.form.ComboBox({
							id : 'reportpatrol',
							store : new Ext.data.JsonStore({
										idProperty : 'Name',
										url : 'employee?method=suggest',
										root : 'root',
										fields : ['Name'],
										params : {
											method:'post'
										}
									}),
							hiddenID:'Name',
							hiddenName:'TName',
							submintVaule : true,
							fieldLabel : '上报监督员',
							displayField : 'Name',
							valueField : 'Name',
							queryParam : ['Name'],
							forceSelection : true,
							hideTrigger : true,
							queryDelay : 1000,
							enableKeyEvents : true,
							minChars : 1,
							mode : 'remote'
						});
					var Tverifypatrol = new Ext.form.Field({
								id : 'verifypatrol',
								name : 'verifypatrol',
								allowBlank : true,
								fieldLabel : "核实监督员"
							});
					var Texaminepatrol = new Ext.form.Field({
								id : 'examinepatrol',
								name : 'examinepatrol',
								allowBlank : true,
								fieldLabel : "核查监督员"
							});
					var Tacceptoperator = new Ext.form.Field({
								id : 'acceptoperator',
								name : 'acceptoperator',
								allowBlank : true,
								fieldLabel : "受理接线员"
							});
					var Taccreditationdutyperson = new Ext.form.Field({
								id : 'accreditationdutyperson',
								name : 'accreditationdutyperson',
								allowBlank : true,
								fieldLabel : "立案值班长"
							});
					var Tdispatchor = new Ext.form.Field({
								id : 'dispatchor',
								name : 'dispatchor',
								allowBlank : true,
								fieldLabel : "派遣员"
							});
					var Tseconddispatchor = new Ext.form.Field({
								id : 'seconddispatchor',
								name : 'seconddispatchor',
								allowBlank : true,
								fieldLabel : "二级派遣员"
							});
					var Tinspectior = new Ext.form.Field({
								id : 'inspectior',
								name : 'inspectior',
								allowBlank : true,
								fieldLabel : "督查员"
							});
					var Texamineoperator = new Ext.form.Field({
								id : 'examineoperator',
								name : 'examineoperator',
								allowBlank : true,
								fieldLabel : "核查接线员"
							});
					var Tclosepeople = new Ext.form.Field({
								id : 'closepeople',
								name : 'closepeople',
								allowBlank : true,
								fieldLabel : "结案人员"
							});
					var Teventurgen = new Ext.form.Field({
								id : 'eventurgen',
								name : 'eventurgen',
								allowBlank : true,
								fieldLabel : "紧急状态"
							});
					var Tdisposetimelimit = new Ext.form.Field({
								id : 'disposetimelimit',
								name : 'disposetimelimit',
								allowBlank : true,
								fieldLabel : "处置时限"
							});
					var Tdisposedeadline = new Ext.form.DateField({
								id : 'disposedeadline',
								name : 'disposedeadline',
								allowBlank : true,
								fieldLabel : "处置截止时间",
                            value:'01/01/1990'
							});
					var Tdisposedate = new Ext.form.DateField({
								id : 'disposedate',
								name : 'disposedate',
								allowBlank : true,
								fieldLabel : "处置时间",
                            value:'01/01/1990'
							});
					var Tdisposetimes = new Ext.form.Field({
								id : 'disposetimes',
								name : 'disposetimes',
								allowBlank : true,
								fieldLabel : "处置用时"
							});
					var Tdelaytimes = new Ext.form.Field({
								id : 'delaytimes',
								name : 'delaytimes',
								allowBlank : true,
								fieldLabel : "延期时长"
							});
					var Tovertimemultiple = new Ext.form.Field({
								id : 'overtimemultiple',
								name : 'overtimemultiple',
								allowBlank : true,
								fieldLabel : "超时倍数"
							});
					var Tacceptstarttime = new Ext.form.DateField({
								id : 'acceptstarttime',
								name : 'acceptstarttime',
								allowBlank : true,
								fieldLabel : "受理开始时间",
                            value:'01/01/1990'
							});
					var Tacceptendtime = new Ext.form.DateField({
								id : 'acceptendtime',
								name : 'acceptendtime',
								allowBlank : true,
								fieldLabel : "受理结束时间",
                            value:'01/01/1990'
							});
					var Tregisterstarttime = new Ext.form.DateField({
								id : 'registerstarttime',
								name : 'registerstarttime',
								allowBlank : true,
								fieldLabel : "立案开始时间",
                            value:'01/01/1990'
							});
					var Tregisterendtime = new Ext.form.DateField({
								id : 'registerendtime',
								name : 'registerendtime',
								allowBlank : true,
								fieldLabel : "立案结束时间",
                            value:'01/01/1990'
							});
					var Tendcasestarttime = new Ext.form.DateField({
								id : 'endcasestarttime',
								name : 'endcasestarttime',
								allowBlank : true,
								fieldLabel : "结案开始时间",
                            value:'01/01/1990'
							});
					var Tendcaseendtime = new Ext.form.DateField({
								id : 'endcaseendtime',
								name : 'endcaseendtime',
								allowBlank : true,
								fieldLabel : "结案结束时间",
                            value:'01/01/1990'
							});
					var Tendcasetime = new Ext.form.DateField({
								id : 'endcasetime',
								name : 'endcasetime',
								allowBlank : true,
								fieldLabel : "结案时间",
                            value:'01/01/1990'
							});
					var Tpostponedtime = new Ext.form.DateField({
								id : 'postponedtime',
								name : 'postponedtime',
								allowBlank : true,
								fieldLabel : "缓办时间",
                            value:'01/01/1990'
							});
					var Tabandontime = new Ext.form.DateField({
								id : 'abandontime',
								name : 'abandontime',
								allowBlank : true,
								fieldLabel : "作废时间",
                            value:'01/01/1990'
							});
					var Tworkingstaff = new Ext.form.Field({
								id : 'workingstaff',
								name : 'workingstaff',
								allowBlank : true,
								fieldLabel : "在办人员"
							});
					var Tworkingdept = new Ext.form.Field({
								id : 'workingdept',
								name : 'workingdept',
								allowBlank : true,
								fieldLabel : "在办部门"
							});
					var Tbackstarttime = new Ext.form.DateField({
								id : 'backstarttime',
								name : 'backstarttime',
								allowBlank : true,
								fieldLabel : "返工开始时间",
                            value:'01/01/1990'
							});
					var Tpostpinedtype = new Ext.form.Field({
								id : 'postpinedtype',
								name : 'postpinedtype',
								allowBlank : true,
								fieldLabel : "缓办类型"
							});
					var Tonticktype = new Ext.form.Field({
								id : 'onticktype',
								name : 'onticktype',
								allowBlank : true,
								fieldLabel : "挂账类型"
							});
					var Tdelaytype = new Ext.form.Field({
								id : 'delaytype',
								name : 'delaytype',
								allowBlank : true,
								fieldLabel : "延期类型"
							});
					var Tpatrolid = new Ext.form.Field({
								id : 'patrolid',
								name : 'patrolid',
								allowBlank : true,
								fieldLabel : "巡查编号"
							});
                    var TdomaindeptID =new Ext.form.Field({
                                id : 'domaindeptID',
                                name : 'domaindeptID',
                                allowBlank : true,
                                fieldLabel : "部门编号"
                            });

					var form = new Ext.form.FormPanel({
                        height:450,
                        width : 350,
						labelAlign : "right",
						frame : true,
                        autoScroll:true,
						items : [Trecdispnum, Ttasknum, TproblemID,
								Trecordtype, Trecordprocessstate,
								Treportpatrol, Tverifypatrol, Texaminepatrol,
								Tacceptoperator, Taccreditationdutyperson,
								Tdispatchor, Tseconddispatchor, Tinspectior,
								Texamineoperator, Tclosepeople, Teventurgen,
								Tdisposedeadline, Tdisposedate, Tdelaytimes,
								Tovertimemultiple, Tacceptstarttime,
								Tacceptendtime, Tregisterstarttime,
								Tregisterendtime, Tendcasestarttime,
								Tendcaseendtime, Tendcasetime, Tpostponedtime,
								Tabandontime, Tworkingstaff, Tworkingdept,
								Tbackstarttime, Tpostpinedtype, Tonticktype,
								Tdelaytype, Tpatrolid,TdomaindeptID],
						url : "casecon?method=edit",
						buttonAlign : "center",
						method : "post",
						buttons : [{
							text : "案件修改",
							icon : "extjsLib/resources/static/images/default/dd/disk.png",
							handler : function() {
								var json = {
									success : function(form, action) {
										var msg = action.result.msg;
										if (msg == "yes") {
											Ext.Msg.alert("成功", "信息修改成功！");
											win.close();
											casestore.reload();
										} else {
											Ext.Msg.alert("失败", "信息修改异常！");
										}
									}
								};
								form.getForm().submit(json);
								casestore.reload();
							}
								// win.close();
						}, {
							text : "关闭",
							icon : "extjsLib/resources/static/images/default/dd/delete.gif",
							handler : function() {
								win.close();
							}
						}]

					});
					var win = new Ext.Window({
								title : "案件修改",
								id : "edit",
								// width : 500,
								width : 350,
								modal : true,
								autoHeight : true,
								items : [form]
							});
					win.show();

					// set the form default values
					form.getForm().setValues({
						"recdispnum" : record.get("recdispnum"),
						"tasknum" : record.get("tasknum"),
						"problemID" : record.get("problemID"),
						"recordtype" : record.get("recordtype"),
						"recordprocessstate" : record.get("recordprocessstate"),
						"reportpatrol" : record.get("reportpatrol"),
						"verifypatrol" : record.get("verifypatrol"),
						"examinepatrol" : record.get("examinepatrol"),
						"acceptoperator" : record.get("acceptoperator"),
						"accreditationdutyperson" : record
								.get("accreditationdutyperson"),
						"dispatchor" : record.get("dispatchor"),
						"seconddispatchor" : record.get("seconddispatchor"),
						"inspectior" : record.get("inspectior"),
						"examineoperator" : record.get("examineoperator"),
						"closepeople" : record.get("closepeople"),
						"eventurgen" : record.get("eventurgen"),
						"disposedeadline" : record.get("disposedeadline"),
						"disposedate" : record.get("disposedate"),
						"delaytimes" : record.get("delaytimes"),
						"overtimemultiple" : record.get("overtimemultiple"),
						"acceptstarttime" : record.get("acceptstarttime"),
						"acceptendtime" : record.get("acceptendtime"),
						"registerstarttime" : record.get("registerstarttime"),
						"registerendtime" : record.get("registerendtime"),
						"endcasestarttime" : record.get("endcasestarttime"),
						"endcaseendtime" : record.get("endcaseendtime"),
						"endcasetime" : record.get("endcasetime"),
						"postponedtime" : record.get("postponedtime"),
						"abandontime" : record.get("abandontime"),
						"workingstaff" : record.get("workingstaff"),
						"workingdept" : record.get("workingdept"),
						"backstarttime" : record.get("backstarttime"),
						"postpinedtype" : record.get("postpinedtype"),
						"onticktype" : record.get("onticktype"),
						"delaytype" : record.get("delaytype"),
						"patrolid" : record.get("patrolid"),
                        "domaindeptID":record.get("domaindeptID")
					});
				}
			}
		}, {
			xtype : "tbseparator"
		}, {
			pressed : false,
			text : '所有案件',
			icon : "static/images/table_refresh.png",
			handler : function() {
				casestore.proxy = aaProxy;
				casestore.load({
							params : {
								start : 0,
								limit : 20
							}
						});
			}
		}],		bbar : [new Ext.PagingToolbar({
							store : casestore,
							displayInfo : true,
							pageSize : 11,
							beforePageText : "当前第",
							afterPageText : "页，共{0}页",
							lastText : "尾页",
							nextText : "下一页",
							prevText : "上一页",
							firstText : "首页",
							refreshText : "刷新页面",
							displayInfo : true,
							displayMsg : "当前显示 {0} - {1}条, 共 {2}",
							emptyMsg : "没有记录"
						})]
	});
	var win = new Ext.Panel({
				layout : 'border',
				height : height,
				width : width,
				items : [casepp]
			});
	win.render(Ext.getBody());
});